<template>
    <component :is="pageRouter"></component>
</template>

<script>
import IllegalBill from '../views/Illegal/IllegalBill';
import useapplyBill from '../views/useapply/useapplyBill';
export default {
    name: 'billDetailWrap',
    data() {
        return {
            pageRouter: ''
        };
    },
    props: {
        showType: {
            type: String
        },
        pageUri: {
            // 页面路由名称
            type: String,
            default: ''
        },
        billId: {
            // 单据id
            type: String,
            default: ''
        },
        templateId: {
            // 菜单id
            type: String,
            default: ''
        },
        disabled: {
            type: Boolean
        }
    },
    components: {
        IllegalBill,
        useapplyBill
    },
    mounted() {
        this.getUri();
    },
    methods: {
        getUri() {
            if (this.pageUri) {
                let parentPage = '';
                if (this.pageUri.indexOf('/') > -1) {
                    parentPage = this.pageUri.split('/')[1];
                } else {
                    parentPage = this.pageUri;
                }
                if (parentPage.indexOf('Audit') > -1) {
                    parentPage = parentPage.replace('Audit', '');
                }
                this.pageRouter = `${parentPage}Bill`;
            }
        },
        goBack() {
            this.$emit('goBack');
        }
    }
};
</script>

<style scoped></style>
